//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS CodeDeploy service.
///
/// CodeDeploy is a deployment service that automates application deployments to Amazon EC2 instances, on-premises instances running in your own facility, serverless Lambda functions, or applications in an Amazon ECS service. You can deploy a nearly unlimited variety of application content, such as an updated Lambda function, updated applications in an Amazon ECS service, code, web and configuration files, executables, packages, scripts, multimedia files, and so on. CodeDeploy can deploy application content stored in Amazon S3 buckets, GitHub repositories, or Bitbucket repositories. You do not need to make changes to your existing code before you can use CodeDeploy. CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications, without many of the risks associated with error-prone manual deployments.  CodeDeploy Components  Use the information in this guide to help you work with the following CodeDeploy components:    Application: A name that uniquely identifies the application you want to deploy. CodeDeploy uses this name, which functions as a container, to ensure the correct combination of revision, deployment configuration, and deployment group are referenced during a deployment.    Deployment group: A set of individual instances, CodeDeploy Lambda deployment configuration settings, or an Amazon ECS service and network details. A Lambda deployment group specifies how to route traffic to a new version of a Lambda function. An Amazon ECS deployment group specifies the service created in Amazon ECS to deploy, a load balancer, and a listener to reroute production traffic to an updated containerized application. An Amazon EC2/On-premises deployment group contains individually tagged instances, Amazon EC2 instances in Amazon EC2 Auto Scaling groups, or both. All deployment groups can specify optional trigger, alarm, and rollback settings.    Deployment configuration: A set of deployment rules and deployment success and failure conditions used by CodeDeploy during a deployment.    Deployment: The process and the components used when updating a Lambda function, a containerized application in an Amazon ECS service, or of installing content on one or more instances.     Application revisions: For an Lambda deployment, this is an AppSpec file that specifies the Lambda function to be updated and one or more functions to validate deployment lifecycle events. For an Amazon ECS deployment, this is an AppSpec file that specifies the Amazon ECS task definition, container, and port where production traffic is rerouted. For an EC2/On-premises deployment, this is an archive file that contains source content—source code, webpages, executable files, and deployment scripts—along with an AppSpec file. Revisions are stored in Amazon S3 buckets or GitHub repositories. For Amazon S3, a revision is uniquely identified by its Amazon S3 object key and its ETag, version, or both. For GitHub, a revision is uniquely identified by its commit ID.   This guide also contains information to help you get details about the instances in your deployments, to make on-premises instances available for CodeDeploy deployments, to get details about a Lambda function deployment, and to get details about Amazon ECS service deployments.  CodeDeploy Information Resources     CodeDeploy User Guide     CodeDeploy API Reference Guide     CLI Reference for CodeDeploy     CodeDeploy Developer Forum
public struct CodeDeploy: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the CodeDeploy client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "CodeDeploy_20141006",
            serviceName: "CodeDeploy",
            serviceIdentifier: "codedeploy",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2014-10-06",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: CodeDeployErrorType.self,
            xmlNamespace: "http://codedeploy.amazonaws.com/doc/2014-10-06/",
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "codedeploy-fips.us-east-1.amazonaws.com",
            "us-east-2": "codedeploy-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "codedeploy-fips.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "codedeploy-fips.us-gov-west-1.amazonaws.com",
            "us-west-1": "codedeploy-fips.us-west-1.amazonaws.com",
            "us-west-2": "codedeploy-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Adds tags to on-premises instances.
    @Sendable
    @inlinable
    public func addTagsToOnPremisesInstances(_ input: AddTagsToOnPremisesInstancesInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "AddTagsToOnPremisesInstances", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds tags to on-premises instances.
    ///
    /// Parameters:
    ///   - instanceNames: The names of the on-premises instances to which to add tags.
    ///   - tags: The tag key-value pairs to add to the on-premises instances. Keys and values are both required. Keys cannot be null or empty strings. Value-only tags are not allowed.
    ///   - logger: Logger use during operation
    @inlinable
    public func addTagsToOnPremisesInstances(
        instanceNames: [String],
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = AddTagsToOnPremisesInstancesInput(
            instanceNames: instanceNames, 
            tags: tags
        )
        return try await self.addTagsToOnPremisesInstances(input, logger: logger)
    }

    /// Gets information about one or more application revisions. The maximum number of application revisions that can be returned is 25.
    @Sendable
    @inlinable
    public func batchGetApplicationRevisions(_ input: BatchGetApplicationRevisionsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetApplicationRevisionsOutput {
        try await self.client.execute(
            operation: "BatchGetApplicationRevisions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about one or more application revisions. The maximum number of application revisions that can be returned is 25.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application about which to get revision information.
    ///   - revisions: An array of RevisionLocation objects that specify information to get about the application revisions, including type and location. The maximum number of RevisionLocation objects you can specify is 25.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetApplicationRevisions(
        applicationName: String,
        revisions: [RevisionLocation],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetApplicationRevisionsOutput {
        let input = BatchGetApplicationRevisionsInput(
            applicationName: applicationName, 
            revisions: revisions
        )
        return try await self.batchGetApplicationRevisions(input, logger: logger)
    }

    /// Gets information about one or more applications. The maximum number of applications that can be returned is 100.
    @Sendable
    @inlinable
    public func batchGetApplications(_ input: BatchGetApplicationsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetApplicationsOutput {
        try await self.client.execute(
            operation: "BatchGetApplications", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about one or more applications. The maximum number of applications that can be returned is 100.
    ///
    /// Parameters:
    ///   - applicationNames: A list of application names separated by spaces. The maximum number of application names you can specify is 100.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetApplications(
        applicationNames: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetApplicationsOutput {
        let input = BatchGetApplicationsInput(
            applicationNames: applicationNames
        )
        return try await self.batchGetApplications(input, logger: logger)
    }

    /// Gets information about one or more deployment groups.
    @Sendable
    @inlinable
    public func batchGetDeploymentGroups(_ input: BatchGetDeploymentGroupsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetDeploymentGroupsOutput {
        try await self.client.execute(
            operation: "BatchGetDeploymentGroups", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about one or more deployment groups.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the applicable user or Amazon Web Services account.
    ///   - deploymentGroupNames: The names of the deployment groups.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetDeploymentGroups(
        applicationName: String,
        deploymentGroupNames: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetDeploymentGroupsOutput {
        let input = BatchGetDeploymentGroupsInput(
            applicationName: applicationName, 
            deploymentGroupNames: deploymentGroupNames
        )
        return try await self.batchGetDeploymentGroups(input, logger: logger)
    }

    ///  This method works, but is deprecated. Use BatchGetDeploymentTargets instead.   Returns an array of one or more instances associated with a deployment. This method works with EC2/On-premises and Lambda compute platforms. The newer BatchGetDeploymentTargets works with all compute platforms. The maximum number of instances that can be returned is 25.
    @available(*, deprecated, message: "This operation is deprecated, use BatchGetDeploymentTargets instead.")
    @Sendable
    @inlinable
    public func batchGetDeploymentInstances(_ input: BatchGetDeploymentInstancesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetDeploymentInstancesOutput {
        try await self.client.execute(
            operation: "BatchGetDeploymentInstances", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  This method works, but is deprecated. Use BatchGetDeploymentTargets instead.   Returns an array of one or more instances associated with a deployment. This method works with EC2/On-premises and Lambda compute platforms. The newer BatchGetDeploymentTargets works with all compute platforms. The maximum number of instances that can be returned is 25.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - instanceIds: The unique IDs of instances used in the deployment. The maximum number of instance IDs you can specify is 25.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This operation is deprecated, use BatchGetDeploymentTargets instead.")
    @inlinable
    public func batchGetDeploymentInstances(
        deploymentId: String,
        instanceIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetDeploymentInstancesOutput {
        let input = BatchGetDeploymentInstancesInput(
            deploymentId: deploymentId, 
            instanceIds: instanceIds
        )
        return try await self.batchGetDeploymentInstances(input, logger: logger)
    }

    ///  Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated BatchGetDeploymentInstances. The maximum number of targets that can be returned is 25. The type of targets returned depends on the deployment's compute platform or deployment method:     EC2/On-premises: Information about Amazon EC2 instance targets.     Lambda: Information about Lambda functions targets.     Amazon ECS: Information about Amazon ECS service targets.     CloudFormation: Information about targets of blue/green deployments initiated by a CloudFormation stack update.
    @Sendable
    @inlinable
    public func batchGetDeploymentTargets(_ input: BatchGetDeploymentTargetsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetDeploymentTargetsOutput {
        try await self.client.execute(
            operation: "BatchGetDeploymentTargets", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated BatchGetDeploymentInstances. The maximum number of targets that can be returned is 25. The type of targets returned depends on the deployment's compute platform or deployment method:     EC2/On-premises: Information about Amazon EC2 instance targets.     Lambda: Information about Lambda functions targets.     Amazon ECS: Information about Amazon ECS service targets.     CloudFormation: Information about targets of blue/green deployments initiated by a CloudFormation stack update.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - targetIds:  The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.   For deployments that use the EC2/On-premises compute platform, the target IDs are Amazon EC2 or on-premises instances IDs, and their target type is instanceTarget.    For deployments that use the Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is instanceTarget.    For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format :. Their target type is ecsTarget.    For deployments that are deployed with CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is cloudFormationTarget.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetDeploymentTargets(
        deploymentId: String,
        targetIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetDeploymentTargetsOutput {
        let input = BatchGetDeploymentTargetsInput(
            deploymentId: deploymentId, 
            targetIds: targetIds
        )
        return try await self.batchGetDeploymentTargets(input, logger: logger)
    }

    /// Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.
    @Sendable
    @inlinable
    public func batchGetDeployments(_ input: BatchGetDeploymentsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetDeploymentsOutput {
        try await self.client.execute(
            operation: "BatchGetDeployments", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.
    ///
    /// Parameters:
    ///   - deploymentIds:  A list of deployment IDs, separated by spaces. The maximum number of deployment IDs you can specify is 25.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetDeployments(
        deploymentIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetDeploymentsOutput {
        let input = BatchGetDeploymentsInput(
            deploymentIds: deploymentIds
        )
        return try await self.batchGetDeployments(input, logger: logger)
    }

    /// Gets information about one or more on-premises instances. The maximum number of on-premises instances that can be returned is 25.
    @Sendable
    @inlinable
    public func batchGetOnPremisesInstances(_ input: BatchGetOnPremisesInstancesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetOnPremisesInstancesOutput {
        try await self.client.execute(
            operation: "BatchGetOnPremisesInstances", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about one or more on-premises instances. The maximum number of on-premises instances that can be returned is 25.
    ///
    /// Parameters:
    ///   - instanceNames: The names of the on-premises instances about which to get information. The maximum number of instance names you can specify is 25.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetOnPremisesInstances(
        instanceNames: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetOnPremisesInstancesOutput {
        let input = BatchGetOnPremisesInstancesInput(
            instanceNames: instanceNames
        )
        return try await self.batchGetOnPremisesInstances(input, logger: logger)
    }

    /// For a blue/green deployment, starts the process of rerouting traffic from instances in the original environment to instances in the replacement environment without waiting for a specified wait time to elapse. (Traffic rerouting, which is achieved by registering instances in the replacement environment with the load balancer, can start as soon as all instances have a status of Ready.)
    @Sendable
    @inlinable
    public func continueDeployment(_ input: ContinueDeploymentInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "ContinueDeployment", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// For a blue/green deployment, starts the process of rerouting traffic from instances in the original environment to instances in the replacement environment without waiting for a specified wait time to elapse. (Traffic rerouting, which is achieved by registering instances in the replacement environment with the load balancer, can start as soon as all instances have a status of Ready.)
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a blue/green deployment for which you want to start rerouting traffic to the replacement environment.
    ///   - deploymentWaitType:  The status of the deployment's waiting period. READY_WAIT indicates that the deployment is ready to start shifting traffic. TERMINATION_WAIT indicates that the traffic is shifted, but the original target is not terminated.
    ///   - logger: Logger use during operation
    @inlinable
    public func continueDeployment(
        deploymentId: String? = nil,
        deploymentWaitType: DeploymentWaitType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = ContinueDeploymentInput(
            deploymentId: deploymentId, 
            deploymentWaitType: deploymentWaitType
        )
        return try await self.continueDeployment(input, logger: logger)
    }

    /// Creates an application.
    @Sendable
    @inlinable
    public func createApplication(_ input: CreateApplicationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateApplicationOutput {
        try await self.client.execute(
            operation: "CreateApplication", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an application.
    ///
    /// Parameters:
    ///   - applicationName: The name of the application. This name must be unique with the applicable user or Amazon Web Services account.
    ///   - computePlatform:  The destination platform type for the deployment (Lambda, Server, or ECS).
    ///   - tags:  The metadata that you apply to CodeDeploy applications to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.
    ///   - logger: Logger use during operation
    @inlinable
    public func createApplication(
        applicationName: String,
        computePlatform: ComputePlatform? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateApplicationOutput {
        let input = CreateApplicationInput(
            applicationName: applicationName, 
            computePlatform: computePlatform, 
            tags: tags
        )
        return try await self.createApplication(input, logger: logger)
    }

    /// Deploys an application revision through the specified deployment group.
    @Sendable
    @inlinable
    public func createDeployment(_ input: CreateDeploymentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDeploymentOutput {
        try await self.client.execute(
            operation: "CreateDeployment", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deploys an application revision through the specified deployment group.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - autoRollbackConfiguration: Configuration information for an automatic rollback that is added when a deployment is created.
    ///   - deploymentConfigName: The name of a deployment configuration associated with the user or Amazon Web Services account. If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, CodeDeployDefault.OneAtATime is used by default.
    ///   - deploymentGroupName: The name of the deployment group.
    ///   - description: A comment about the deployment.
    ///   - fileExistsBehavior: Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment. The fileExistsBehavior parameter takes any of the following values:   DISALLOW: The deployment fails. This is also the default behavior if no option is specified.   OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.   RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
    ///   - ignoreApplicationStopFailures:  If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if ApplicationStop fails, the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, the deployment continues with BlockTraffic. If AfterBlockTraffic fails, the deployment continues with ApplicationStop.  If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.  During a deployment, the CodeDeploy agent runs the scripts specified for ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.  If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use ignoreApplicationStopFailures to specify that the ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic failures should be ignored.
    ///   - overrideAlarmConfiguration: Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call CreateDeployment to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.  If you specify an overrideAlarmConfiguration, you need the UpdateDeploymentGroup IAM permission when calling CreateDeployment.
    ///   - revision:  The type and location of the revision to deploy.
    ///   - targetInstances:  Information about the instances that belong to the replacement environment in a blue/green deployment.
    ///   - updateOutdatedInstancesOnly:  Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDeployment(
        applicationName: String,
        autoRollbackConfiguration: AutoRollbackConfiguration? = nil,
        deploymentConfigName: String? = nil,
        deploymentGroupName: String? = nil,
        description: String? = nil,
        fileExistsBehavior: FileExistsBehavior? = nil,
        ignoreApplicationStopFailures: Bool? = nil,
        overrideAlarmConfiguration: AlarmConfiguration? = nil,
        revision: RevisionLocation? = nil,
        targetInstances: TargetInstances? = nil,
        updateOutdatedInstancesOnly: Bool? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDeploymentOutput {
        let input = CreateDeploymentInput(
            applicationName: applicationName, 
            autoRollbackConfiguration: autoRollbackConfiguration, 
            deploymentConfigName: deploymentConfigName, 
            deploymentGroupName: deploymentGroupName, 
            description: description, 
            fileExistsBehavior: fileExistsBehavior, 
            ignoreApplicationStopFailures: ignoreApplicationStopFailures, 
            overrideAlarmConfiguration: overrideAlarmConfiguration, 
            revision: revision, 
            targetInstances: targetInstances, 
            updateOutdatedInstancesOnly: updateOutdatedInstancesOnly
        )
        return try await self.createDeployment(input, logger: logger)
    }

    ///  Creates a deployment configuration.
    @Sendable
    @inlinable
    public func createDeploymentConfig(_ input: CreateDeploymentConfigInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDeploymentConfigOutput {
        try await self.client.execute(
            operation: "CreateDeploymentConfig", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Creates a deployment configuration.
    ///
    /// Parameters:
    ///   - computePlatform: The destination platform type for the deployment (Lambda, Server, or ECS).
    ///   - deploymentConfigName: The name of the deployment configuration to create.
    ///   - minimumHealthyHosts: The minimum number of healthy instances that should be available at any time during the deployment. There are two parameters expected in the input: type and value. The type parameter takes either of the following values:   HOST_COUNT: The value parameter represents the minimum number of healthy instances as an absolute value.   FLEET_PERCENT: The value parameter represents the minimum number of healthy instances as a percentage of the total number of instances in the deployment. If you specify FLEET_PERCENT, at the start of the deployment, CodeDeploy converts the percentage to the equivalent number of instances and rounds up fractional instances.   The value parameter takes an integer. For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95.
    ///   - trafficRoutingConfig: The configuration that specifies how the deployment traffic is routed.
    ///   - zonalConfig: Configure the ZonalConfig object if you want CodeDeploy to deploy your application to one Availability Zone at a time, within an Amazon Web Services Region. For more information about the zonal configuration feature, see zonal configuration in the CodeDeploy User Guide.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDeploymentConfig(
        computePlatform: ComputePlatform? = nil,
        deploymentConfigName: String,
        minimumHealthyHosts: MinimumHealthyHosts? = nil,
        trafficRoutingConfig: TrafficRoutingConfig? = nil,
        zonalConfig: ZonalConfig? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDeploymentConfigOutput {
        let input = CreateDeploymentConfigInput(
            computePlatform: computePlatform, 
            deploymentConfigName: deploymentConfigName, 
            minimumHealthyHosts: minimumHealthyHosts, 
            trafficRoutingConfig: trafficRoutingConfig, 
            zonalConfig: zonalConfig
        )
        return try await self.createDeploymentConfig(input, logger: logger)
    }

    /// Creates a deployment group to which application revisions are deployed.
    @Sendable
    @inlinable
    public func createDeploymentGroup(_ input: CreateDeploymentGroupInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDeploymentGroupOutput {
        try await self.client.execute(
            operation: "CreateDeploymentGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a deployment group to which application revisions are deployed.
    ///
    /// Parameters:
    ///   - alarmConfiguration: Information to add about Amazon CloudWatch alarms when the deployment group is created.
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - autoRollbackConfiguration: Configuration information for an automatic rollback that is added when a deployment group is created.
    ///   - autoScalingGroups: A list of associated Amazon EC2 Auto Scaling groups.
    ///   - blueGreenDeploymentConfiguration: Information about blue/green deployment options for a deployment group.
    ///   - deploymentConfigName: If specified, the deployment configuration name can be either one of the predefined configurations provided with CodeDeploy or a custom deployment configuration that you create by calling the create deployment configuration operation.  CodeDeployDefault.OneAtATime is the default deployment configuration. It is used if a configuration isn't specified for the deployment or deployment group. For more information about the predefined deployment configurations in CodeDeploy, see Working with Deployment Configurations in CodeDeploy in the CodeDeploy User Guide.
    ///   - deploymentGroupName: The name of a new deployment group for the specified application.
    ///   - deploymentStyle: Information about the type of deployment, in-place or blue/green, that you want to run and whether to route deployment traffic behind a load balancer.
    ///   - ec2TagFilters: The Amazon EC2 tags on which to filter. The deployment group includes Amazon EC2 instances with any of the specified tags. Cannot be used in the same call as ec2TagSet.
    ///   - ec2TagSet: Information about groups of tags applied to Amazon EC2 instances. The deployment group includes only Amazon EC2 instances identified by all the tag groups. Cannot be used in the same call as ec2TagFilters.
    ///   - ecsServices:  The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name pair using the format :.
    ///   - loadBalancerInfo: Information about the load balancer used in a deployment.
    ///   - onPremisesInstanceTagFilters: The on-premises instance tags on which to filter. The deployment group includes on-premises instances with any of the specified tags. Cannot be used in the same call as OnPremisesTagSet.
    ///   - onPremisesTagSet: Information about groups of tags applied to on-premises instances. The deployment group includes only on-premises instances identified by all of the tag groups. Cannot be used in the same call as onPremisesInstanceTagFilters.
    ///   - outdatedInstancesStrategy: Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. If this option is set to UPDATE or is unspecified, CodeDeploy initiates one or more 'auto-update outdated instances' deployments to apply the deployed application revision to the new Amazon EC2 instances. If this option is set to IGNORE, CodeDeploy does not initiate a deployment to update the new Amazon EC2 instances. This may result in instances having different revisions.
    ///   - serviceRoleArn: A service role Amazon Resource Name (ARN) that allows CodeDeploy to act on the user's behalf when interacting with Amazon Web Services services.
    ///   - tags:  The metadata that you apply to CodeDeploy deployment groups to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.
    ///   - terminationHookEnabled: This parameter only applies if you are using CodeDeploy with Amazon EC2 Auto Scaling. For more information, see Integrating CodeDeploy with Amazon EC2 Auto Scaling in the CodeDeploy User Guide. Set terminationHookEnabled to true to have CodeDeploy install a termination hook into your Auto Scaling group when you create a deployment group. When this hook is installed, CodeDeploy will perform termination deployments. For information about termination deployments, see Enabling termination deployments during Auto Scaling scale-in events in the CodeDeploy User Guide. For more information about Auto Scaling scale-in events, see the Scale in topic in the Amazon EC2 Auto Scaling User Guide.
    ///   - triggerConfigurations: Information about triggers to create when the deployment group is created. For examples, see Create a Trigger for an CodeDeploy Event in the CodeDeploy User Guide.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDeploymentGroup(
        alarmConfiguration: AlarmConfiguration? = nil,
        applicationName: String,
        autoRollbackConfiguration: AutoRollbackConfiguration? = nil,
        autoScalingGroups: [String]? = nil,
        blueGreenDeploymentConfiguration: BlueGreenDeploymentConfiguration? = nil,
        deploymentConfigName: String? = nil,
        deploymentGroupName: String,
        deploymentStyle: DeploymentStyle? = nil,
        ec2TagFilters: [EC2TagFilter]? = nil,
        ec2TagSet: EC2TagSet? = nil,
        ecsServices: [ECSService]? = nil,
        loadBalancerInfo: LoadBalancerInfo? = nil,
        onPremisesInstanceTagFilters: [TagFilter]? = nil,
        onPremisesTagSet: OnPremisesTagSet? = nil,
        outdatedInstancesStrategy: OutdatedInstancesStrategy? = nil,
        serviceRoleArn: String,
        tags: [Tag]? = nil,
        terminationHookEnabled: Bool? = nil,
        triggerConfigurations: [TriggerConfig]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDeploymentGroupOutput {
        let input = CreateDeploymentGroupInput(
            alarmConfiguration: alarmConfiguration, 
            applicationName: applicationName, 
            autoRollbackConfiguration: autoRollbackConfiguration, 
            autoScalingGroups: autoScalingGroups, 
            blueGreenDeploymentConfiguration: blueGreenDeploymentConfiguration, 
            deploymentConfigName: deploymentConfigName, 
            deploymentGroupName: deploymentGroupName, 
            deploymentStyle: deploymentStyle, 
            ec2TagFilters: ec2TagFilters, 
            ec2TagSet: ec2TagSet, 
            ecsServices: ecsServices, 
            loadBalancerInfo: loadBalancerInfo, 
            onPremisesInstanceTagFilters: onPremisesInstanceTagFilters, 
            onPremisesTagSet: onPremisesTagSet, 
            outdatedInstancesStrategy: outdatedInstancesStrategy, 
            serviceRoleArn: serviceRoleArn, 
            tags: tags, 
            terminationHookEnabled: terminationHookEnabled, 
            triggerConfigurations: triggerConfigurations
        )
        return try await self.createDeploymentGroup(input, logger: logger)
    }

    /// Deletes an application.
    @Sendable
    @inlinable
    public func deleteApplication(_ input: DeleteApplicationInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteApplication", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an application.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteApplication(
        applicationName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteApplicationInput(
            applicationName: applicationName
        )
        return try await self.deleteApplication(input, logger: logger)
    }

    /// Deletes a deployment configuration.  A deployment configuration cannot be deleted if it is currently in use. Predefined configurations cannot be deleted.
    @Sendable
    @inlinable
    public func deleteDeploymentConfig(_ input: DeleteDeploymentConfigInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteDeploymentConfig", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a deployment configuration.  A deployment configuration cannot be deleted if it is currently in use. Predefined configurations cannot be deleted.
    ///
    /// Parameters:
    ///   - deploymentConfigName: The name of a deployment configuration associated with the user or Amazon Web Services account.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDeploymentConfig(
        deploymentConfigName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteDeploymentConfigInput(
            deploymentConfigName: deploymentConfigName
        )
        return try await self.deleteDeploymentConfig(input, logger: logger)
    }

    /// Deletes a deployment group.
    @Sendable
    @inlinable
    public func deleteDeploymentGroup(_ input: DeleteDeploymentGroupInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteDeploymentGroupOutput {
        try await self.client.execute(
            operation: "DeleteDeploymentGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a deployment group.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - deploymentGroupName: The name of a deployment group for the specified application.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDeploymentGroup(
        applicationName: String,
        deploymentGroupName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteDeploymentGroupOutput {
        let input = DeleteDeploymentGroupInput(
            applicationName: applicationName, 
            deploymentGroupName: deploymentGroupName
        )
        return try await self.deleteDeploymentGroup(input, logger: logger)
    }

    /// Deletes a GitHub account connection.
    @Sendable
    @inlinable
    public func deleteGitHubAccountToken(_ input: DeleteGitHubAccountTokenInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGitHubAccountTokenOutput {
        try await self.client.execute(
            operation: "DeleteGitHubAccountToken", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a GitHub account connection.
    ///
    /// Parameters:
    ///   - tokenName: The name of the GitHub account connection to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGitHubAccountToken(
        tokenName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGitHubAccountTokenOutput {
        let input = DeleteGitHubAccountTokenInput(
            tokenName: tokenName
        )
        return try await self.deleteGitHubAccountToken(input, logger: logger)
    }

    /// Deletes resources linked to an external ID. This action only applies if you have configured blue/green deployments through CloudFormation.   It is not necessary to call this action directly. CloudFormation calls it on your behalf when it needs to delete stack resources. This action is offered publicly in case you need to delete resources to comply with General Data Protection Regulation (GDPR) requirements.
    @Sendable
    @inlinable
    public func deleteResourcesByExternalId(_ input: DeleteResourcesByExternalIdInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteResourcesByExternalIdOutput {
        try await self.client.execute(
            operation: "DeleteResourcesByExternalId", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes resources linked to an external ID. This action only applies if you have configured blue/green deployments through CloudFormation.   It is not necessary to call this action directly. CloudFormation calls it on your behalf when it needs to delete stack resources. This action is offered publicly in case you need to delete resources to comply with General Data Protection Regulation (GDPR) requirements.
    ///
    /// Parameters:
    ///   - externalId: The unique ID of an external resource (for example, a CloudFormation stack ID) that is linked to one or more CodeDeploy resources.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteResourcesByExternalId(
        externalId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteResourcesByExternalIdOutput {
        let input = DeleteResourcesByExternalIdInput(
            externalId: externalId
        )
        return try await self.deleteResourcesByExternalId(input, logger: logger)
    }

    /// Deregisters an on-premises instance.
    @Sendable
    @inlinable
    public func deregisterOnPremisesInstance(_ input: DeregisterOnPremisesInstanceInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeregisterOnPremisesInstance", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deregisters an on-premises instance.
    ///
    /// Parameters:
    ///   - instanceName: The name of the on-premises instance to deregister.
    ///   - logger: Logger use during operation
    @inlinable
    public func deregisterOnPremisesInstance(
        instanceName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeregisterOnPremisesInstanceInput(
            instanceName: instanceName
        )
        return try await self.deregisterOnPremisesInstance(input, logger: logger)
    }

    /// Gets information about an application.
    @Sendable
    @inlinable
    public func getApplication(_ input: GetApplicationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetApplicationOutput {
        try await self.client.execute(
            operation: "GetApplication", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about an application.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - logger: Logger use during operation
    @inlinable
    public func getApplication(
        applicationName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetApplicationOutput {
        let input = GetApplicationInput(
            applicationName: applicationName
        )
        return try await self.getApplication(input, logger: logger)
    }

    /// Gets information about an application revision.
    @Sendable
    @inlinable
    public func getApplicationRevision(_ input: GetApplicationRevisionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetApplicationRevisionOutput {
        try await self.client.execute(
            operation: "GetApplicationRevision", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about an application revision.
    ///
    /// Parameters:
    ///   - applicationName: The name of the application that corresponds to the revision.
    ///   - revision: Information about the application revision to get, including type and location.
    ///   - logger: Logger use during operation
    @inlinable
    public func getApplicationRevision(
        applicationName: String,
        revision: RevisionLocation,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetApplicationRevisionOutput {
        let input = GetApplicationRevisionInput(
            applicationName: applicationName, 
            revision: revision
        )
        return try await self.getApplicationRevision(input, logger: logger)
    }

    /// Gets information about a deployment.  The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256 property of the returned appSpecContent object to get the content of the deployment’s AppSpec file.
    @Sendable
    @inlinable
    public func getDeployment(_ input: GetDeploymentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDeploymentOutput {
        try await self.client.execute(
            operation: "GetDeployment", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about a deployment.  The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256 property of the returned appSpecContent object to get the content of the deployment’s AppSpec file.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment associated with the user or Amazon Web Services account.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDeployment(
        deploymentId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDeploymentOutput {
        let input = GetDeploymentInput(
            deploymentId: deploymentId
        )
        return try await self.getDeployment(input, logger: logger)
    }

    /// Gets information about a deployment configuration.
    @Sendable
    @inlinable
    public func getDeploymentConfig(_ input: GetDeploymentConfigInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDeploymentConfigOutput {
        try await self.client.execute(
            operation: "GetDeploymentConfig", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about a deployment configuration.
    ///
    /// Parameters:
    ///   - deploymentConfigName: The name of a deployment configuration associated with the user or Amazon Web Services account.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDeploymentConfig(
        deploymentConfigName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDeploymentConfigOutput {
        let input = GetDeploymentConfigInput(
            deploymentConfigName: deploymentConfigName
        )
        return try await self.getDeploymentConfig(input, logger: logger)
    }

    /// Gets information about a deployment group.
    @Sendable
    @inlinable
    public func getDeploymentGroup(_ input: GetDeploymentGroupInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDeploymentGroupOutput {
        try await self.client.execute(
            operation: "GetDeploymentGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about a deployment group.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - deploymentGroupName: The name of a deployment group for the specified application.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDeploymentGroup(
        applicationName: String,
        deploymentGroupName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDeploymentGroupOutput {
        let input = GetDeploymentGroupInput(
            applicationName: applicationName, 
            deploymentGroupName: deploymentGroupName
        )
        return try await self.getDeploymentGroup(input, logger: logger)
    }

    /// Gets information about an instance as part of a deployment.
    @available(*, deprecated, message: "This operation is deprecated, use GetDeploymentTarget instead.")
    @Sendable
    @inlinable
    public func getDeploymentInstance(_ input: GetDeploymentInstanceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDeploymentInstanceOutput {
        try await self.client.execute(
            operation: "GetDeploymentInstance", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about an instance as part of a deployment.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - instanceId:  The unique ID of an instance in the deployment group.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This operation is deprecated, use GetDeploymentTarget instead.")
    @inlinable
    public func getDeploymentInstance(
        deploymentId: String,
        instanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDeploymentInstanceOutput {
        let input = GetDeploymentInstanceInput(
            deploymentId: deploymentId, 
            instanceId: instanceId
        )
        return try await self.getDeploymentInstance(input, logger: logger)
    }

    ///  Returns information about a deployment target.
    @Sendable
    @inlinable
    public func getDeploymentTarget(_ input: GetDeploymentTargetInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDeploymentTargetOutput {
        try await self.client.execute(
            operation: "GetDeploymentTarget", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns information about a deployment target.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - targetId:  The unique ID of a deployment target.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDeploymentTarget(
        deploymentId: String,
        targetId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDeploymentTargetOutput {
        let input = GetDeploymentTargetInput(
            deploymentId: deploymentId, 
            targetId: targetId
        )
        return try await self.getDeploymentTarget(input, logger: logger)
    }

    ///  Gets information about an on-premises instance.
    @Sendable
    @inlinable
    public func getOnPremisesInstance(_ input: GetOnPremisesInstanceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetOnPremisesInstanceOutput {
        try await self.client.execute(
            operation: "GetOnPremisesInstance", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Gets information about an on-premises instance.
    ///
    /// Parameters:
    ///   - instanceName:  The name of the on-premises instance about which to get information.
    ///   - logger: Logger use during operation
    @inlinable
    public func getOnPremisesInstance(
        instanceName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetOnPremisesInstanceOutput {
        let input = GetOnPremisesInstanceInput(
            instanceName: instanceName
        )
        return try await self.getOnPremisesInstance(input, logger: logger)
    }

    /// Lists information about revisions for an application.
    @Sendable
    @inlinable
    public func listApplicationRevisions(_ input: ListApplicationRevisionsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationRevisionsOutput {
        try await self.client.execute(
            operation: "ListApplicationRevisions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists information about revisions for an application.
    ///
    /// Parameters:
    ///   - applicationName:  The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - deployed:  Whether to list revisions based on whether the revision is the target revision of a deployment group:     include: List revisions that are target revisions of a deployment group.    exclude: Do not list revisions that are target revisions of a deployment group.    ignore: List all revisions.
    ///   - nextToken: An identifier returned from the previous ListApplicationRevisions call. It can be used to return the next set of applications in the list.
    ///   - s3Bucket:  An Amazon S3 bucket name to limit the search for revisions.  If set to null, all of the user's buckets are searched.
    ///   - s3KeyPrefix:  A key prefix for the set of Amazon S3 objects to limit the search for revisions.
    ///   - sortBy: The column name to use to sort the list results:    registerTime: Sort by the time the revisions were registered with CodeDeploy.    firstUsedTime: Sort by the time the revisions were first used in a deployment.    lastUsedTime: Sort by the time the revisions were last used in a deployment.   If not specified or set to null, the results are returned in an arbitrary order.
    ///   - sortOrder:  The order in which to sort the list results:     ascending: ascending order.    descending: descending order.   If not specified, the results are sorted in ascending order. If set to null, the results are sorted in an arbitrary order.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplicationRevisions(
        applicationName: String,
        deployed: ListStateFilterAction? = nil,
        nextToken: String? = nil,
        s3Bucket: String? = nil,
        s3KeyPrefix: String? = nil,
        sortBy: ApplicationRevisionSortBy? = nil,
        sortOrder: SortOrder? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationRevisionsOutput {
        let input = ListApplicationRevisionsInput(
            applicationName: applicationName, 
            deployed: deployed, 
            nextToken: nextToken, 
            s3Bucket: s3Bucket, 
            s3KeyPrefix: s3KeyPrefix, 
            sortBy: sortBy, 
            sortOrder: sortOrder
        )
        return try await self.listApplicationRevisions(input, logger: logger)
    }

    /// Lists the applications registered with the user or Amazon Web Services account.
    @Sendable
    @inlinable
    public func listApplications(_ input: ListApplicationsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationsOutput {
        try await self.client.execute(
            operation: "ListApplications", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the applications registered with the user or Amazon Web Services account.
    ///
    /// Parameters:
    ///   - nextToken: An identifier returned from the previous list applications call. It can be used to return the next set of applications in the list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplications(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationsOutput {
        let input = ListApplicationsInput(
            nextToken: nextToken
        )
        return try await self.listApplications(input, logger: logger)
    }

    /// Lists the deployment configurations with the user or Amazon Web Services account.
    @Sendable
    @inlinable
    public func listDeploymentConfigs(_ input: ListDeploymentConfigsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDeploymentConfigsOutput {
        try await self.client.execute(
            operation: "ListDeploymentConfigs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the deployment configurations with the user or Amazon Web Services account.
    ///
    /// Parameters:
    ///   - nextToken: An identifier returned from the previous ListDeploymentConfigs call. It can be used to return the next set of deployment configurations in the list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDeploymentConfigs(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDeploymentConfigsOutput {
        let input = ListDeploymentConfigsInput(
            nextToken: nextToken
        )
        return try await self.listDeploymentConfigs(input, logger: logger)
    }

    /// Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.
    @Sendable
    @inlinable
    public func listDeploymentGroups(_ input: ListDeploymentGroupsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDeploymentGroupsOutput {
        try await self.client.execute(
            operation: "ListDeploymentGroups", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - nextToken: An identifier returned from the previous list deployment groups call. It can be used to return the next set of deployment groups in the list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDeploymentGroups(
        applicationName: String,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDeploymentGroupsOutput {
        let input = ListDeploymentGroupsInput(
            applicationName: applicationName, 
            nextToken: nextToken
        )
        return try await self.listDeploymentGroups(input, logger: logger)
    }

    ///  The newer BatchGetDeploymentTargets should be used instead because it works with all compute types. ListDeploymentInstances throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.   Lists the instance for a deployment associated with the user or Amazon Web Services account.
    @available(*, deprecated, message: "This operation is deprecated, use ListDeploymentTargets instead.")
    @Sendable
    @inlinable
    public func listDeploymentInstances(_ input: ListDeploymentInstancesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDeploymentInstancesOutput {
        try await self.client.execute(
            operation: "ListDeploymentInstances", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  The newer BatchGetDeploymentTargets should be used instead because it works with all compute types. ListDeploymentInstances throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.   Lists the instance for a deployment associated with the user or Amazon Web Services account.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - instanceStatusFilter: A subset of instances to list by status:    Pending: Include those instances with pending deployments.    InProgress: Include those instances where deployments are still in progress.    Succeeded: Include those instances with successful deployments.    Failed: Include those instances with failed deployments.    Skipped: Include those instances with skipped deployments.    Unknown: Include those instances with deployments in an unknown state.
    ///   - instanceTypeFilter: The set of instances in a blue/green deployment, either those in the original environment ("BLUE") or those in the replacement environment ("GREEN"), for which you want to view instance information.
    ///   - nextToken: An identifier returned from the previous list deployment instances call. It can be used to return the next set of deployment instances in the list.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This operation is deprecated, use ListDeploymentTargets instead.")
    @inlinable
    public func listDeploymentInstances(
        deploymentId: String,
        instanceStatusFilter: [InstanceStatus]? = nil,
        instanceTypeFilter: [InstanceType]? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDeploymentInstancesOutput {
        let input = ListDeploymentInstancesInput(
            deploymentId: deploymentId, 
            instanceStatusFilter: instanceStatusFilter, 
            instanceTypeFilter: instanceTypeFilter, 
            nextToken: nextToken
        )
        return try await self.listDeploymentInstances(input, logger: logger)
    }

    ///  Returns an array of target IDs that are associated a deployment.
    @Sendable
    @inlinable
    public func listDeploymentTargets(_ input: ListDeploymentTargetsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDeploymentTargetsOutput {
        try await self.client.execute(
            operation: "ListDeploymentTargets", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns an array of target IDs that are associated a deployment.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - nextToken:  A token identifier returned from the previous ListDeploymentTargets call. It can be used to return the next set of deployment targets in the list.
    ///   - targetFilters:  A key used to filter the returned targets. The two valid values are:    TargetStatus - A TargetStatus filter string can be Failed, InProgress, Pending, Ready, Skipped, Succeeded, or Unknown.     ServerInstanceLabel - A ServerInstanceLabel filter string can be Blue or Green.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDeploymentTargets(
        deploymentId: String,
        nextToken: String? = nil,
        targetFilters: [TargetFilterName: [String]]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDeploymentTargetsOutput {
        let input = ListDeploymentTargetsInput(
            deploymentId: deploymentId, 
            nextToken: nextToken, 
            targetFilters: targetFilters
        )
        return try await self.listDeploymentTargets(input, logger: logger)
    }

    /// Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.
    @Sendable
    @inlinable
    public func listDeployments(_ input: ListDeploymentsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDeploymentsOutput {
        try await self.client.execute(
            operation: "ListDeployments", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.  If applicationName is specified, then deploymentGroupName must be specified. If it is not specified, then deploymentGroupName must not be specified.
    ///   - createTimeRange: A time range (start and end) for returning a subset of the list of deployments.
    ///   - deploymentGroupName: The name of a deployment group for the specified application.  If deploymentGroupName is specified, then applicationName must be specified. If it is not specified, then applicationName must not be specified.
    ///   - externalId: The unique ID of an external resource for returning deployments linked to the external resource.
    ///   - includeOnlyStatuses: A subset of deployments to list by status:    Created: Include created deployments in the resulting list.    Queued: Include queued deployments in the resulting list.    In Progress: Include in-progress deployments in the resulting list.    Succeeded: Include successful deployments in the resulting list.    Failed: Include failed deployments in the resulting list.    Stopped: Include stopped deployments in the resulting list.
    ///   - nextToken: An identifier returned from the previous list deployments call. It can be used to return the next set of deployments in the list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDeployments(
        applicationName: String? = nil,
        createTimeRange: TimeRange? = nil,
        deploymentGroupName: String? = nil,
        externalId: String? = nil,
        includeOnlyStatuses: [DeploymentStatus]? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDeploymentsOutput {
        let input = ListDeploymentsInput(
            applicationName: applicationName, 
            createTimeRange: createTimeRange, 
            deploymentGroupName: deploymentGroupName, 
            externalId: externalId, 
            includeOnlyStatuses: includeOnlyStatuses, 
            nextToken: nextToken
        )
        return try await self.listDeployments(input, logger: logger)
    }

    /// Lists the names of stored connections to GitHub accounts.
    @Sendable
    @inlinable
    public func listGitHubAccountTokenNames(_ input: ListGitHubAccountTokenNamesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGitHubAccountTokenNamesOutput {
        try await self.client.execute(
            operation: "ListGitHubAccountTokenNames", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the names of stored connections to GitHub accounts.
    ///
    /// Parameters:
    ///   - nextToken: An identifier returned from the previous ListGitHubAccountTokenNames call. It can be used to return the next set of names in the list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGitHubAccountTokenNames(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGitHubAccountTokenNamesOutput {
        let input = ListGitHubAccountTokenNamesInput(
            nextToken: nextToken
        )
        return try await self.listGitHubAccountTokenNames(input, logger: logger)
    }

    /// Gets a list of names for one or more on-premises instances. Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.
    @Sendable
    @inlinable
    public func listOnPremisesInstances(_ input: ListOnPremisesInstancesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListOnPremisesInstancesOutput {
        try await self.client.execute(
            operation: "ListOnPremisesInstances", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a list of names for one or more on-premises instances. Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.
    ///
    /// Parameters:
    ///   - nextToken: An identifier returned from the previous list on-premises instances call. It can be used to return the next set of on-premises instances in the list.
    ///   - registrationStatus: The registration status of the on-premises instances:    Deregistered: Include deregistered on-premises instances in the resulting list.    Registered: Include registered on-premises instances in the resulting list.
    ///   - tagFilters: The on-premises instance tags that are used to restrict the on-premises instance names returned.
    ///   - logger: Logger use during operation
    @inlinable
    public func listOnPremisesInstances(
        nextToken: String? = nil,
        registrationStatus: RegistrationStatus? = nil,
        tagFilters: [TagFilter]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListOnPremisesInstancesOutput {
        let input = ListOnPremisesInstancesInput(
            nextToken: nextToken, 
            registrationStatus: registrationStatus, 
            tagFilters: tagFilters
        )
        return try await self.listOnPremisesInstances(input, logger: logger)
    }

    ///  Returns a list of tags for the resource identified by a specified Amazon Resource Name (ARN). Tags are used to organize and categorize your CodeDeploy resources.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns a list of tags for the resource identified by a specified Amazon Resource Name (ARN). Tags are used to organize and categorize your CodeDeploy resources.
    ///
    /// Parameters:
    ///   - nextToken: An identifier returned from the previous ListTagsForResource call. It can be used to return the next set of applications in the list.
    ///   - resourceArn:  The ARN of a CodeDeploy resource. ListTagsForResource returns all the tags associated with the resource that is identified by the ResourceArn.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        nextToken: String? = nil,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            nextToken: nextToken, 
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    ///  Sets the result of a Lambda validation function. The function validates lifecycle hooks during a deployment that uses the Lambda or Amazon ECS compute platform. For Lambda deployments, the available lifecycle hooks are BeforeAllowTraffic and AfterAllowTraffic. For Amazon ECS deployments, the available lifecycle hooks are BeforeInstall, AfterInstall, AfterAllowTestTraffic, BeforeAllowTraffic, and AfterAllowTraffic. Lambda validation functions return Succeeded or Failed. For more information, see AppSpec 'hooks' Section for an Lambda Deployment  and AppSpec 'hooks' Section for an Amazon ECS Deployment.
    @Sendable
    @inlinable
    public func putLifecycleEventHookExecutionStatus(_ input: PutLifecycleEventHookExecutionStatusInput, logger: Logger = AWSClient.loggingDisabled) async throws -> PutLifecycleEventHookExecutionStatusOutput {
        try await self.client.execute(
            operation: "PutLifecycleEventHookExecutionStatus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Sets the result of a Lambda validation function. The function validates lifecycle hooks during a deployment that uses the Lambda or Amazon ECS compute platform. For Lambda deployments, the available lifecycle hooks are BeforeAllowTraffic and AfterAllowTraffic. For Amazon ECS deployments, the available lifecycle hooks are BeforeInstall, AfterInstall, AfterAllowTestTraffic, BeforeAllowTraffic, and AfterAllowTraffic. Lambda validation functions return Succeeded or Failed. For more information, see AppSpec 'hooks' Section for an Lambda Deployment  and AppSpec 'hooks' Section for an Amazon ECS Deployment.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a deployment. Pass this ID to a Lambda function that validates a deployment lifecycle event.
    ///   - lifecycleEventHookExecutionId:  The execution ID of a deployment's lifecycle hook. A deployment lifecycle hook is specified in the hooks section of the AppSpec file.
    ///   - status: The result of a Lambda function that validates a deployment lifecycle event. The values listed in Valid Values are valid for lifecycle statuses in general; however, only Succeeded and Failed can be passed successfully in your API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func putLifecycleEventHookExecutionStatus(
        deploymentId: String? = nil,
        lifecycleEventHookExecutionId: String? = nil,
        status: LifecycleEventStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutLifecycleEventHookExecutionStatusOutput {
        let input = PutLifecycleEventHookExecutionStatusInput(
            deploymentId: deploymentId, 
            lifecycleEventHookExecutionId: lifecycleEventHookExecutionId, 
            status: status
        )
        return try await self.putLifecycleEventHookExecutionStatus(input, logger: logger)
    }

    /// Registers with CodeDeploy a revision for the specified application.
    @Sendable
    @inlinable
    public func registerApplicationRevision(_ input: RegisterApplicationRevisionInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "RegisterApplicationRevision", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Registers with CodeDeploy a revision for the specified application.
    ///
    /// Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - description: A comment about the revision.
    ///   - revision: Information about the application revision to register, including type and location.
    ///   - logger: Logger use during operation
    @inlinable
    public func registerApplicationRevision(
        applicationName: String,
        description: String? = nil,
        revision: RevisionLocation,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = RegisterApplicationRevisionInput(
            applicationName: applicationName, 
            description: description, 
            revision: revision
        )
        return try await self.registerApplicationRevision(input, logger: logger)
    }

    /// Registers an on-premises instance.  Only one IAM ARN (an IAM session ARN or IAM user ARN) is supported in the request. You cannot use both.
    @Sendable
    @inlinable
    public func registerOnPremisesInstance(_ input: RegisterOnPremisesInstanceInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "RegisterOnPremisesInstance", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Registers an on-premises instance.  Only one IAM ARN (an IAM session ARN or IAM user ARN) is supported in the request. You cannot use both.
    ///
    /// Parameters:
    ///   - iamSessionArn: The ARN of the IAM session to associate with the on-premises instance.
    ///   - iamUserArn: The ARN of the user to associate with the on-premises instance.
    ///   - instanceName: The name of the on-premises instance to register.
    ///   - logger: Logger use during operation
    @inlinable
    public func registerOnPremisesInstance(
        iamSessionArn: String? = nil,
        iamUserArn: String? = nil,
        instanceName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = RegisterOnPremisesInstanceInput(
            iamSessionArn: iamSessionArn, 
            iamUserArn: iamUserArn, 
            instanceName: instanceName
        )
        return try await self.registerOnPremisesInstance(input, logger: logger)
    }

    /// Removes one or more tags from one or more on-premises instances.
    @Sendable
    @inlinable
    public func removeTagsFromOnPremisesInstances(_ input: RemoveTagsFromOnPremisesInstancesInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "RemoveTagsFromOnPremisesInstances", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes one or more tags from one or more on-premises instances.
    ///
    /// Parameters:
    ///   - instanceNames: The names of the on-premises instances from which to remove tags.
    ///   - tags: The tag key-value pairs to remove from the on-premises instances.
    ///   - logger: Logger use during operation
    @inlinable
    public func removeTagsFromOnPremisesInstances(
        instanceNames: [String],
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = RemoveTagsFromOnPremisesInstancesInput(
            instanceNames: instanceNames, 
            tags: tags
        )
        return try await self.removeTagsFromOnPremisesInstances(input, logger: logger)
    }

    /// In a blue/green deployment, overrides any specified wait time and starts terminating instances immediately after the traffic routing is complete.
    @available(*, deprecated, message: "This operation is deprecated, use ContinueDeployment with DeploymentWaitType instead.")
    @Sendable
    @inlinable
    public func skipWaitTimeForInstanceTermination(_ input: SkipWaitTimeForInstanceTerminationInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "SkipWaitTimeForInstanceTermination", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// In a blue/green deployment, overrides any specified wait time and starts terminating instances immediately after the traffic routing is complete.
    ///
    /// Parameters:
    ///   - deploymentId:  The unique ID of a blue/green deployment for which you want to skip the instance termination wait time.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This operation is deprecated, use ContinueDeployment with DeploymentWaitType instead.")
    @inlinable
    public func skipWaitTimeForInstanceTermination(
        deploymentId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = SkipWaitTimeForInstanceTerminationInput(
            deploymentId: deploymentId
        )
        return try await self.skipWaitTimeForInstanceTermination(input, logger: logger)
    }

    /// Attempts to stop an ongoing deployment.
    @Sendable
    @inlinable
    public func stopDeployment(_ input: StopDeploymentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StopDeploymentOutput {
        try await self.client.execute(
            operation: "StopDeployment", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Attempts to stop an ongoing deployment.
    ///
    /// Parameters:
    ///   - autoRollbackEnabled:  Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopDeployment(
        autoRollbackEnabled: Bool? = nil,
        deploymentId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopDeploymentOutput {
        let input = StopDeploymentInput(
            autoRollbackEnabled: autoRollbackEnabled, 
            deploymentId: deploymentId
        )
        return try await self.stopDeployment(input, logger: logger)
    }

    ///  Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.
    ///
    /// Parameters:
    ///   - resourceArn:  The ARN of a resource, such as a CodeDeploy application or deployment group.
    ///   - tags:  A list of tags that TagResource associates with a resource. The resource is identified by the ResourceArn input parameter.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    ///  Disassociates a resource from a list of tags. The resource is identified by the ResourceArn input parameter. The tags are identified by the list of keys in the TagKeys input parameter.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Disassociates a resource from a list of tags. The resource is identified by the ResourceArn input parameter. The tags are identified by the list of keys in the TagKeys input parameter.
    ///
    /// Parameters:
    ///   - resourceArn:  The Amazon Resource Name (ARN) that specifies from which resource to disassociate the tags with the keys in the TagKeys input parameter.
    ///   - tagKeys:  A list of keys of Tag objects. The Tag objects identified by the keys are disassociated from the resource specified by the ResourceArn input parameter.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Changes the name of an application.
    @Sendable
    @inlinable
    public func updateApplication(_ input: UpdateApplicationInput, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateApplication", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes the name of an application.
    ///
    /// Parameters:
    ///   - applicationName: The current name of the application you want to change.
    ///   - newApplicationName: The new name to give the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateApplication(
        applicationName: String? = nil,
        newApplicationName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateApplicationInput(
            applicationName: applicationName, 
            newApplicationName: newApplicationName
        )
        return try await self.updateApplication(input, logger: logger)
    }

    /// Changes information about a deployment group.
    @Sendable
    @inlinable
    public func updateDeploymentGroup(_ input: UpdateDeploymentGroupInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateDeploymentGroupOutput {
        try await self.client.execute(
            operation: "UpdateDeploymentGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes information about a deployment group.
    ///
    /// Parameters:
    ///   - alarmConfiguration: Information to add or change about Amazon CloudWatch alarms when the deployment group is updated.
    ///   - applicationName: The application name that corresponds to the deployment group to update.
    ///   - autoRollbackConfiguration: Information for an automatic rollback configuration that is added or changed when a deployment group is updated.
    ///   - autoScalingGroups: The replacement list of Auto Scaling groups to be included in the deployment group, if you want to change them.   To keep the Auto Scaling groups, enter their names or do not specify this parameter.    To remove Auto Scaling groups, specify a non-null empty list of Auto Scaling group names to detach all CodeDeploy-managed Auto Scaling lifecycle hooks. For examples, see Amazon EC2 instances in an Amazon EC2 Auto Scaling group fail to launch and receive the error "Heartbeat Timeout" in the CodeDeploy User Guide.
    ///   - blueGreenDeploymentConfiguration: Information about blue/green deployment options for a deployment group.
    ///   - currentDeploymentGroupName: The current name of the deployment group.
    ///   - deploymentConfigName: The replacement deployment configuration name to use, if you want to change it.
    ///   - deploymentStyle: Information about the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer.
    ///   - ec2TagFilters: The replacement set of Amazon EC2 tags on which to filter, if you want to change them. To keep the existing tags, enter their names. To remove tags, do not enter any tag names.
    ///   - ec2TagSet: Information about groups of tags applied to on-premises instances. The deployment group includes only Amazon EC2 instances identified by all the tag groups.
    ///   - ecsServices:  The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name pair using the format :.
    ///   - loadBalancerInfo: Information about the load balancer used in a deployment.
    ///   - newDeploymentGroupName: The new name of the deployment group, if you want to change it.
    ///   - onPremisesInstanceTagFilters: The replacement set of on-premises instance tags on which to filter, if you want to change them. To keep the existing tags, enter their names. To remove tags, do not enter any tag names.
    ///   - onPremisesTagSet: Information about an on-premises instance tag set. The deployment group includes only on-premises instances identified by all the tag groups.
    ///   - outdatedInstancesStrategy: Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. If this option is set to UPDATE or is unspecified, CodeDeploy initiates one or more 'auto-update outdated instances' deployments to apply the deployed application revision to the new Amazon EC2 instances. If this option is set to IGNORE, CodeDeploy does not initiate a deployment to update the new Amazon EC2 instances. This may result in instances having different revisions.
    ///   - serviceRoleArn: A replacement ARN for the service role, if you want to change it.
    ///   - terminationHookEnabled: This parameter only applies if you are using CodeDeploy with Amazon EC2 Auto Scaling. For more information, see Integrating CodeDeploy with Amazon EC2 Auto Scaling in the CodeDeploy User Guide. Set terminationHookEnabled to true to have CodeDeploy install a termination hook into your Auto Scaling group when you update a deployment group. When this hook is installed, CodeDeploy will perform termination deployments. For information about termination deployments, see Enabling termination deployments during Auto Scaling scale-in events in the CodeDeploy User Guide. For more information about Auto Scaling scale-in events, see the Scale in topic in the Amazon EC2 Auto Scaling User Guide.
    ///   - triggerConfigurations: Information about triggers to change when the deployment group is updated. For examples, see Edit a Trigger in a CodeDeploy Deployment Group in the CodeDeploy User Guide.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateDeploymentGroup(
        alarmConfiguration: AlarmConfiguration? = nil,
        applicationName: String,
        autoRollbackConfiguration: AutoRollbackConfiguration? = nil,
        autoScalingGroups: [String]? = nil,
        blueGreenDeploymentConfiguration: BlueGreenDeploymentConfiguration? = nil,
        currentDeploymentGroupName: String,
        deploymentConfigName: String? = nil,
        deploymentStyle: DeploymentStyle? = nil,
        ec2TagFilters: [EC2TagFilter]? = nil,
        ec2TagSet: EC2TagSet? = nil,
        ecsServices: [ECSService]? = nil,
        loadBalancerInfo: LoadBalancerInfo? = nil,
        newDeploymentGroupName: String? = nil,
        onPremisesInstanceTagFilters: [TagFilter]? = nil,
        onPremisesTagSet: OnPremisesTagSet? = nil,
        outdatedInstancesStrategy: OutdatedInstancesStrategy? = nil,
        serviceRoleArn: String? = nil,
        terminationHookEnabled: Bool? = nil,
        triggerConfigurations: [TriggerConfig]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateDeploymentGroupOutput {
        let input = UpdateDeploymentGroupInput(
            alarmConfiguration: alarmConfiguration, 
            applicationName: applicationName, 
            autoRollbackConfiguration: autoRollbackConfiguration, 
            autoScalingGroups: autoScalingGroups, 
            blueGreenDeploymentConfiguration: blueGreenDeploymentConfiguration, 
            currentDeploymentGroupName: currentDeploymentGroupName, 
            deploymentConfigName: deploymentConfigName, 
            deploymentStyle: deploymentStyle, 
            ec2TagFilters: ec2TagFilters, 
            ec2TagSet: ec2TagSet, 
            ecsServices: ecsServices, 
            loadBalancerInfo: loadBalancerInfo, 
            newDeploymentGroupName: newDeploymentGroupName, 
            onPremisesInstanceTagFilters: onPremisesInstanceTagFilters, 
            onPremisesTagSet: onPremisesTagSet, 
            outdatedInstancesStrategy: outdatedInstancesStrategy, 
            serviceRoleArn: serviceRoleArn, 
            terminationHookEnabled: terminationHookEnabled, 
            triggerConfigurations: triggerConfigurations
        )
        return try await self.updateDeploymentGroup(input, logger: logger)
    }
}

extension CodeDeploy {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: CodeDeploy, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension CodeDeploy {
    /// Return PaginatorSequence for operation ``listApplicationRevisions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationRevisionsPaginator(
        _ input: ListApplicationRevisionsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationRevisionsInput, ListApplicationRevisionsOutput> {
        return .init(
            input: input,
            command: self.listApplicationRevisions,
            inputKey: \ListApplicationRevisionsInput.nextToken,
            outputKey: \ListApplicationRevisionsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplicationRevisions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - applicationName:  The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - deployed:  Whether to list revisions based on whether the revision is the target revision of a deployment group:     include: List revisions that are target revisions of a deployment group.    exclude: Do not list revisions that are target revisions of a deployment group.    ignore: List all revisions.
    ///   - s3Bucket:  An Amazon S3 bucket name to limit the search for revisions.  If set to null, all of the user's buckets are searched.
    ///   - s3KeyPrefix:  A key prefix for the set of Amazon S3 objects to limit the search for revisions.
    ///   - sortBy: The column name to use to sort the list results:    registerTime: Sort by the time the revisions were registered with CodeDeploy.    firstUsedTime: Sort by the time the revisions were first used in a deployment.    lastUsedTime: Sort by the time the revisions were last used in a deployment.   If not specified or set to null, the results are returned in an arbitrary order.
    ///   - sortOrder:  The order in which to sort the list results:     ascending: ascending order.    descending: descending order.   If not specified, the results are sorted in ascending order. If set to null, the results are sorted in an arbitrary order.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationRevisionsPaginator(
        applicationName: String,
        deployed: ListStateFilterAction? = nil,
        s3Bucket: String? = nil,
        s3KeyPrefix: String? = nil,
        sortBy: ApplicationRevisionSortBy? = nil,
        sortOrder: SortOrder? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationRevisionsInput, ListApplicationRevisionsOutput> {
        let input = ListApplicationRevisionsInput(
            applicationName: applicationName, 
            deployed: deployed, 
            s3Bucket: s3Bucket, 
            s3KeyPrefix: s3KeyPrefix, 
            sortBy: sortBy, 
            sortOrder: sortOrder
        )
        return self.listApplicationRevisionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        _ input: ListApplicationsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationsInput, ListApplicationsOutput> {
        return .init(
            input: input,
            command: self.listApplications,
            inputKey: \ListApplicationsInput.nextToken,
            outputKey: \ListApplicationsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationsInput, ListApplicationsOutput> {
        let input = ListApplicationsInput(
        )
        return self.listApplicationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDeploymentConfigs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDeploymentConfigsPaginator(
        _ input: ListDeploymentConfigsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDeploymentConfigsInput, ListDeploymentConfigsOutput> {
        return .init(
            input: input,
            command: self.listDeploymentConfigs,
            inputKey: \ListDeploymentConfigsInput.nextToken,
            outputKey: \ListDeploymentConfigsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDeploymentConfigs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - logger: Logger used for logging
    @inlinable
    public func listDeploymentConfigsPaginator(
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDeploymentConfigsInput, ListDeploymentConfigsOutput> {
        let input = ListDeploymentConfigsInput(
        )
        return self.listDeploymentConfigsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDeploymentGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDeploymentGroupsPaginator(
        _ input: ListDeploymentGroupsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDeploymentGroupsInput, ListDeploymentGroupsOutput> {
        return .init(
            input: input,
            command: self.listDeploymentGroups,
            inputKey: \ListDeploymentGroupsInput.nextToken,
            outputKey: \ListDeploymentGroupsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDeploymentGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDeploymentGroupsPaginator(
        applicationName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDeploymentGroupsInput, ListDeploymentGroupsOutput> {
        let input = ListDeploymentGroupsInput(
            applicationName: applicationName
        )
        return self.listDeploymentGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDeploymentInstances(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @available(*, deprecated, message: "This operation is deprecated, use ListDeploymentTargets instead.")
    @inlinable
    public func listDeploymentInstancesPaginator(
        _ input: ListDeploymentInstancesInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDeploymentInstancesInput, ListDeploymentInstancesOutput> {
        return .init(
            input: input,
            command: self.listDeploymentInstances,
            inputKey: \ListDeploymentInstancesInput.nextToken,
            outputKey: \ListDeploymentInstancesOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDeploymentInstances(_:logger:)``.
    ///
    /// - Parameters:
    ///   - deploymentId:  The unique ID of a deployment.
    ///   - instanceStatusFilter: A subset of instances to list by status:    Pending: Include those instances with pending deployments.    InProgress: Include those instances where deployments are still in progress.    Succeeded: Include those instances with successful deployments.    Failed: Include those instances with failed deployments.    Skipped: Include those instances with skipped deployments.    Unknown: Include those instances with deployments in an unknown state.
    ///   - instanceTypeFilter: The set of instances in a blue/green deployment, either those in the original environment ("BLUE") or those in the replacement environment ("GREEN"), for which you want to view instance information.
    ///   - logger: Logger used for logging
    @available(*, deprecated, message: "This operation is deprecated, use ListDeploymentTargets instead.")
    @inlinable
    public func listDeploymentInstancesPaginator(
        deploymentId: String,
        instanceStatusFilter: [InstanceStatus]? = nil,
        instanceTypeFilter: [InstanceType]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDeploymentInstancesInput, ListDeploymentInstancesOutput> {
        let input = ListDeploymentInstancesInput(
            deploymentId: deploymentId, 
            instanceStatusFilter: instanceStatusFilter, 
            instanceTypeFilter: instanceTypeFilter
        )
        return self.listDeploymentInstancesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDeployments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDeploymentsPaginator(
        _ input: ListDeploymentsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDeploymentsInput, ListDeploymentsOutput> {
        return .init(
            input: input,
            command: self.listDeployments,
            inputKey: \ListDeploymentsInput.nextToken,
            outputKey: \ListDeploymentsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDeployments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - applicationName: The name of an CodeDeploy application associated with the user or Amazon Web Services account.  If applicationName is specified, then deploymentGroupName must be specified. If it is not specified, then deploymentGroupName must not be specified.
    ///   - createTimeRange: A time range (start and end) for returning a subset of the list of deployments.
    ///   - deploymentGroupName: The name of a deployment group for the specified application.  If deploymentGroupName is specified, then applicationName must be specified. If it is not specified, then applicationName must not be specified.
    ///   - externalId: The unique ID of an external resource for returning deployments linked to the external resource.
    ///   - includeOnlyStatuses: A subset of deployments to list by status:    Created: Include created deployments in the resulting list.    Queued: Include queued deployments in the resulting list.    In Progress: Include in-progress deployments in the resulting list.    Succeeded: Include successful deployments in the resulting list.    Failed: Include failed deployments in the resulting list.    Stopped: Include stopped deployments in the resulting list.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDeploymentsPaginator(
        applicationName: String? = nil,
        createTimeRange: TimeRange? = nil,
        deploymentGroupName: String? = nil,
        externalId: String? = nil,
        includeOnlyStatuses: [DeploymentStatus]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDeploymentsInput, ListDeploymentsOutput> {
        let input = ListDeploymentsInput(
            applicationName: applicationName, 
            createTimeRange: createTimeRange, 
            deploymentGroupName: deploymentGroupName, 
            externalId: externalId, 
            includeOnlyStatuses: includeOnlyStatuses
        )
        return self.listDeploymentsPaginator(input, logger: logger)
    }
}

extension CodeDeploy.ListApplicationRevisionsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeDeploy.ListApplicationRevisionsInput {
        return .init(
            applicationName: self.applicationName,
            deployed: self.deployed,
            nextToken: token,
            s3Bucket: self.s3Bucket,
            s3KeyPrefix: self.s3KeyPrefix,
            sortBy: self.sortBy,
            sortOrder: self.sortOrder
        )
    }
}

extension CodeDeploy.ListApplicationsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeDeploy.ListApplicationsInput {
        return .init(
            nextToken: token
        )
    }
}

extension CodeDeploy.ListDeploymentConfigsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeDeploy.ListDeploymentConfigsInput {
        return .init(
            nextToken: token
        )
    }
}

extension CodeDeploy.ListDeploymentGroupsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeDeploy.ListDeploymentGroupsInput {
        return .init(
            applicationName: self.applicationName,
            nextToken: token
        )
    }
}

extension CodeDeploy.ListDeploymentInstancesInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeDeploy.ListDeploymentInstancesInput {
        return .init(
            deploymentId: self.deploymentId,
            instanceStatusFilter: self.instanceStatusFilter,
            instanceTypeFilter: self.instanceTypeFilter,
            nextToken: token
        )
    }
}

extension CodeDeploy.ListDeploymentsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeDeploy.ListDeploymentsInput {
        return .init(
            applicationName: self.applicationName,
            createTimeRange: self.createTimeRange,
            deploymentGroupName: self.deploymentGroupName,
            externalId: self.externalId,
            includeOnlyStatuses: self.includeOnlyStatuses,
            nextToken: token
        )
    }
}

// MARK: Waiters

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension CodeDeploy {
    /// Waiter for operation ``getDeployment(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilDeploymentSuccessful(
        _ input: GetDeploymentInput,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<GetDeploymentInput, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("deploymentInfo.status", expected: "Succeeded")),
                .init(state: .failure, matcher: try! JMESPathMatcher("deploymentInfo.status", expected: "Failed")),
                .init(state: .failure, matcher: try! JMESPathMatcher("deploymentInfo.status", expected: "Stopped")),
            ],
            minDelayTime: .seconds(15),
            command: self.getDeployment
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``getDeployment(_:logger:)``.
    ///
    /// - Parameters:
    ///   - deploymentId:  The unique ID of a deployment associated with the user or Amazon Web Services account.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilDeploymentSuccessful(
        deploymentId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = GetDeploymentInput(
            deploymentId: deploymentId
        )
        try await self.waitUntilDeploymentSuccessful(input, logger: logger)
    }
}
